# This is a sample Python script.

# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
from time import sleep

import appium
import schedule
def print_hi(name):
    # Use a breakpoint in the code line below to debug your script.
    print(f'Hi, {name}')  # Press ⌘F8 to toggle the breakpoint.


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print_hi('PyCharm')
# pytest cases --html=report.html --self-contained-html
# isUpdate = False
#
# list = [1,2]
# def job1():
#     print("job1 start")
#     for idx in range(len(list)):
#         if idx == 0:
#             print("job1 continue")
#         else:
#             global isUpdate
#             isUpdate = True
#
#
# schedule.every(3).seconds.do(job1)
#
# while True:
#     if isUpdate:
#         # 清空任务
#         schedule.clear()
#     else:
#         schedule.run_pending()
#         sleep(1)
#


# def scope_test():
#     def do_local():
#         spam = "local spam"  # 只是声明了一个新的局部变量，作用域：local
#
#     def do_nonlocal():
#         nonlocal spam   # 声明 nonlocal，即外层函数的变量
#         spam = "nonlocal spam"
#
#     def do_global():
#         global spam
#         spam += " spam"
#
#     spam = "test spam"
#     do_local()
#     print("After local assignment:", spam)
#     do_nonlocal()
#     print("After nonlocal assignment:", spam)
#     do_global()
#     print("After global assignment:", spam)
#
#
# spam = "global"   # 全局变量 global
# scope_test()
# print("In global scope:", spam)



# 清空任务
# schedule.clear()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/

#
# driver.find_element(By.XPATH, "//*[@text='国内期现']/../../..").click()
# sleep(1)
# driver.press_keycode(AndroidKey.BACK)
# sleep(1)
# # back()
#
# # to_all()
# driver.find_element(By.ID, 'll_data_report').click()
# sleep(1)
# driver.find_element(By.XPATH, "//*[@text='国内期权']/../../..").click()
# sleep(1)
# # back()
# driver.press_keycode(AndroidKey.BACK)
# sleep(1)
#
# # to_all()
# driver.find_element(By.ID, 'll_data_report').click()
# sleep(1)
# driver.find_element(By.XPATH, "//*[@text='现货专区']/../../..").click()
# sleep(1)
# title = driver.find_element(By.ID, "tv_name_top").text
# assert "现货专区" in title
# driver.press_keycode(AndroidKey.BACK)
# sleep(1)
# back()

